﻿//<![CDATA[
var nameControlId = '{0}';
var hiddenControlId = '{1}';

function onClientClose{2}(oWnd, eventArgs) {{
    var argument = eventArgs.get_argument();
    
    if(argument && argument.name && argument.path && argument.nodeId)
    {{
        $('#' + nameControlId).html('<a target="_blank" href="' + argument.path + '">' + argument.name + '</a>');
        $('#' + hiddenControlId).val(argument.nodeId);
    }}
    //your code here
    //remove the OnClientClose function to avoid
    //adding it for a second time when the window is shown again
    oWnd.remove_close(onClientClose{2});
}}
//]]>
